<html>
	{% include "../common_head.html" %}
	<body>
	{% include "../common_menus.html" %}
	<div id="content">
	<div id="rakontu_form_style" class="rakontu_form">
	<form name="read" action="/{{dir_visit}}/{{url_read}}?{{entry.urlQuery}}
	{% if curating %}
		&{{url_query_curate}}={{url_option_yes}}
	{% endif %}
	{% if show_versions %}
		&{{url_query_versions}}={{url_option_yes}}
	{% endif %}
	" method="post">
	
	{% if things_member_can_do %}
		<table cellpadding="0" cellspacing="0" style="width:100%;border:none;">
		<tr>
		<td align="left" valign="center" style="border:none;margin:0;">
	{% endif %}
	<span style="font-size:1.2em;"><b>{{entry.getImageLinkForType}}
	{% if curating %}  
		{% if entry.flaggedForRemoval %}
			<input type="submit" class="flag_red" value="" name="unflag|{{entry.key}}" title="{{template_click_here_to_unflag}}">
		{% else %}
			<input type="submit" class="flag_green" value="" name="flag|{{entry.key}}" title="{{template_click_here_to_flag_this_entry}}">
		{% endif %}
	{% endif %}
	{% if things_member_can_do %}
		{{entry.titleWithCategoryIfResource}}</b></span>
		</td>
		<td align="right" style="border:none;margin:0;">
		<select name="nextAction">
		{% for key in things_member_can_do.keys|sorted %}
			<option value="{{things_member_can_do|dictLookup:key}}">{{key}}</option>
		{% endfor %}
		</select>
		<input type="submit" name="doSomething" value="{{template_go|capfirst}}" class="button_small">
		</td></tr></table>
	{% else %}
		<h2>{{entry.titleWithCategoryIfResource}}</h2>
	{% endif %}
	
	{% include "read_or_preview_entry.html" %}
	
	{% if member_can_edit_entry %}
		<div class="rightalign">
		(<a href="/{{dir_visit}}/{{entry.typeAsURL}}?{{entry.urlQuery}}">{{template_change}}</a>)
		{% if rakontu.allowsAttachments %}
			{% if attachments %}
				(<a href="/{{dir_visit}}/{{url_attachments}}?{{entry.urlQuery}}">{{template_change_attachments}}</a>)
			{% else %}
				(<a href="/{{dir_visit}}/{{url_attachments}}?{{entry.urlQuery}}">{{template_add_attachment}}</a>)
			{% endif %}
		{% endif %}
		{% ifequal entry.creator.key current_member.key %}
			{% if entry.additionalEditors %}
				(<a href="/{{dir_visit}}/{{url_editors}}?{{entry.urlQuery}}">{{template_change_editors}} {{entry.typeForDisplay}}</a>)
			{% else %}
				(<a href="/{{dir_visit}}/{{url_editors}}?{{entry.urlQuery}}">{{template_add_editors}} {{entry.typeForDisplay}}</a>)
			{% endif %}
		{% endifequal %}
		</div>
	{% endif %}
	
	</div>
		
	{{template_contributed_by}}
	{% if entry.attributedToMember %}
			{% if entry.creator.active %}
				{{entry.creator.linkString}}
				{% ifequal entry.creator.key current_member.key %}
					 ({{template_you}})
				{% endifequal %}
			{% else %}
				{{template_the_former_member}} "{{entry.creator.nickname}}"
			{% endif %}
	{% else %}
		{% if entry.character.active %}
			{{entry.character.linkString}}
		{% else %}
			{{template_the_former_character}} "{{entry.character.name}}"
		{% endif %}
	{% endif %}
	{% if entry.collectedOffline %}
		{% if current_member.timeFormat %}
			{{entry.collected|timeZone:current_member.timeZoneName|time:current_member.timeFormat}}
		{% endif %}
		{{entry.collected|timeZone:current_member.timeZoneName|date:current_member.dateFormat}}
		{% if entry.liaison %}
			({{template_entered_by}} {{entry.liaison.linkString}}
			{% if current_member.timeFormat %}
				{{entry.published|timeZone:current_member.timeZoneName|time:current_member.timeFormat}}
			{% endif %}
			{{entry.published|timeZone:current_member.timeZoneName|date:current_member.dateFormat}}).
		{% endif %}
	{% else %}
		{% if current_member.timeFormat %}
			{{entry.published|timeZone:current_member.timeZoneName|time:current_member.timeFormat}}
		{% endif %}
		{{entry.published|timeZone:current_member.timeZoneName|date:current_member.dateFormat}}.
	{% endif %}
	</p>
	
	{% comment %}
	{% if user_is_admin %}
		<div class="rightalign">
		{{template_shift_by}} 
			<input type="text" name="shiftHours" size="10" value="1" maxlength="{{maxlength_name}}"/> {{template_hours}}
			<input type="submit" value="{{template_go}}" name="shiftTime" class="button_small">
		</div>
	{% endif %}
	{% endcomment %}
	
	{% if member_can_nudge_entry %}
		<fieldset><p>
		{% for i in num_nudge_categories|makeRange %}
			{% if rakontu.nudgeCategories|listLookup:i %}
				{{rakontu.nudgeCategories|listLookup:i}}
				<select name="nudge{{i}}">
					{% for aValue in quick_nudge_values %}
						<option value="{{aValue}}"{% if aValue|equalTest:0 %} selected="yes"{% endif %}>{{aValue}}</option>
					{% endfor %}
					</select>
			{% endif %}
		{% endfor %}
		({{template_maximum}} {{nudge_points_member_can_assign}}) <input type="submit" name="quickNudge" value="{{button_quick_nudge}}" class="button_small"
						{% if current_member.showButtonTooltips %}
							title="{{"quick_nudge"|buttonTooltip}}"
						{% endif %}
		></p>
		</fieldset>
	{% endif %}
	
	<h3>{{template_annotations_to_this}}</h3>
	
	{% include "../common_time_range.html" %}
	
	{% if grid_options_on_top %}
		{% include "../common_grid_options.html" %}
	{% endif %}
	
	{% include "../common_grid.html" %}
	
	{% if not grid_options_on_top %}
		{% include "../common_grid_options.html" %}
	{% endif %}
	
	{% if counts %}
	    <h3>{{template_counts_of_annotations_to}} {{entry.title}}</h3>
	    
	 		<p></p>
	    	<table cellspacing=0 cellpadding=0 style="width:100%;">
	 			{% for name in count_names %}
					<th>{{name|capfirst}}</th>
				{% endfor %}
	      	</tr>
			{% for count in counts %}
				<td>{% if count %}
						{{count}}
					{% else %}
						&nbsp;
					{% endif %}
				</td>
			{% endfor %}
			</tr>
			</table>
	{% endif %}

	{% if show_versions and versions %}
		<h3>{{template_versions}} <input type="submit" value="{{template_hide_versions}}" name="hideVersions" class="button_small"
						{% if current_member.showButtonTooltips %}
							title="{{"hiding_entry_history"|buttonTooltip}}"
						{% endif %}
		></h3>
		<div class="blurb">
		{% for version in versions %}
			<p><b>{{version.title}}</b> 
			{% if current_member.timeFormat %}
				({{version.created|timeZone:current_member.timeZoneName|time:current_member.timeFormat}}
				{{version.created|timeZone:current_member.timeZoneName|date:current_member.dateFormat}})</p>
			{% else %}
				({{version.created|timeZone:current_member.timeZoneName|date:current_member.dateFormat}})</p>
			{% endif %}
			
			<p>{{version.text_formatted}}</p>
			{% if not versions|isLastInSeries:version %}
				<hr>
			{% endif %}
		{% endfor %}
	{% else %}
		{% if versions %}
			<p></p>
			<input type="submit" value="{{template_show_versions}}" name="showVersions" class="button_small"
						{% if current_member.showButtonTooltips %}
							title="{{"showing_entry_history"|buttonTooltip}}"
						{% endif %}
			>
		{% endif %}
		</div>
	{% endif %}
	<div class="rightalign">{{template_activity_points}}: {{entry.activityPoints}}</div>
	
	{% if user_is_admin %}
		{% ifequal entry.type "resource" %}
			{% if entry.resourceForHelpPage %}
				<div class="rightalign">
				<a href="/{{dir_admin}}/{{url_recopy_system_resource}}?{{entry.urlQuery}}">{{template_recopy_system_resource}}</a>
				</div>
			{% endif %}
		{% endifequal %}
	{% endif %}
	
	</form>
	</div>
	</div>
	{% include "../common_footer.html" %}
	</body>
</html>
